<?php
include_once 'conn/conn.php';
$id = $_GET[id];
$sql = mysql_query("select * from tb_friend where id=$id");
$row = mysql_fetch_array($sql);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="templets/css/common.css" type="text/css" />
<title>文章分类</title>
</head>

<body>
<?php 
if ($_POST["action"] == "do"){
	$name = $_POST['td_name'];
	$urls = $_POST['td_urls'];
	$id = $_POST['id'];
	$sql = "update tb_friend set company='$name',urls='$urls' where id=$id";
	if (mysql_query($sql)){
		echo ("<script type=\"text/javascript\">alert('修改成功！');window.location.href='furls_manage.php';</script>");
		exit();
	}else {
		echo("<script language='javascript'>alert('失败，请联系管理员！');window.location.href='furls_manage.php';</script>");
		exit();
	}
}
?>
<div id="man_zone">	
	<form action="" method="post">
		<table width="99%" border="0" align="center"  cellpadding="1" cellspacing="0" class="table_style">
    		<tr>
      			<td width="18%" class="left_title_1 nos"><span class="left-title">公司名称：</span></td>
      			<td width="82%" class="nos"><input type="text" name="td_name" value="<?php echo ($row["company"]);?>" /></td>
    		</tr>
    		<tr>
      			<td width="18%" class="left_title_2 nos"><span class="left-title">公司网址：</span></td>
      			<td width="82%" class="nos"><input type="text" name="td_pwd" value="<?php echo ($row["urls"]);?>" /></td>
    		</tr>
    		<tr>
				<td colspan="2" align="right" class="nos">
					<input type="submit" value="提交" />
					<input type="reset" value="重置" />
					<input type="hidden" name="action" value="do" />
					<input type="hidden" name="id" value="<?php echo($row["id"]);?>"/>
				</td>
			</tr>
		</table>
	</form>
</div>
</body>
</html>